
# safe_load方法
"""
safe_load(yaml文件对象) :将yaml格式的数据转化为python对象，更加安全 。
"""

import yaml
from pprint import pprint

def read_yaml_data(filename):
    with open(filename,encoding='utf-8') as f:
        python_obj = yaml.safe_load(f)
        print("数据类型:{}".format(type(python_obj)))
        return python_obj


if __name__ == '__main__':
    pprint(read_yaml_data('demo.yml'))
